#!/bin/sh
#
# check deps recursively looking for a specified package ($grepstr)

grepstr='virtualbox'

for i in $(ls repos/blackarch/packages/)
do
  echo "[$i]"
  for j in $(yay -Si $i | grep -i 'depends on' | cut -d ':' -f 2-)
  do
    yay -Si $j | grep -i 'depends on' | cut -d ':' -f 2- | tr -s ' ' '\n' |
    grep -i "$grepstr"
  done
done

